package org.apache.elasticjob;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob;

public class MyDataflowJob implements DataflowJob<String> {

	@Override
	public List<String> fetchData(ShardingContext shardingContext) {
		List<String> data = new ArrayList<>();
		data.add("数据1");
		data.add("数据2");
		data.add("数据3");
		data.add("数据4");
		return data;
	}

	@Override
	public void processData(ShardingContext shardingContext, List<String> list) {
		System.out.println(LocalDateTime.now()+"处理数据："+list);
	}
}
